package com.example.springcloud.controller;

/**
 * @ClassName StorageController
 * @Author Admin
 * @Date 2020/9/20 2:35
 * @Version 1.0
 **/

import com.example.springcloud.domain.CommonResult;
import com.example.springcloud.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StorageController {

    @Autowired
    private StorageService storageService;


    //扣减库存
    @RequestMapping("/storage/decrease")
    public CommonResult decrease(Long productId, Integer count) {
        storageService.decrease(productId, count);
        return new CommonResult(200, "扣减库存成功！");
    }
}